1. Field of the Invention
The invention relates to an image processing apparatus applicable to an image scanner capable of re-reading out image data from a memory, a controlling method for the image processing apparatus, and a program.
2. Description of Related Art
There have heretofore been image reading apparatuses for reading images from originals. Among the image reading apparatuses, for example, an image scanner (hereinafter simply referred to as the scanner) is provided with an image sensor for reading an image from an original, an image memory for temporarily storing therein image data outputted from the image sensor, etc. A specific example of the scanner is shown in FIG. 13 of the accompanying drawings.
FIG. 13 is a block diagram showing an example of the construction of the essential portions of the control system of an image reading apparatus (scanner) according to the prior art.
In FIG. 13, the scanner is provided with an image sensor 1304 for front side image, an image sensor 1309 for back side image, an image processing portion 1349, a line memory 1350, a CPU 1351, an interface 1352, a sending portion 1353 and an image memory 1355, and is connected to an external equipment (e.g. a host computer) 1357. In FIG. 13, the image processing portion 1349, the line memory 1350, the CPU 1351, the interface 1352 and the sending portion 1353 together constitute processing means 1354.
The scanner shown in FIG. 13 serves to read an original image while conveying an original, and when it has read the image on the surface of the original by an image sensor 1304 for front side image, image data corresponding to one line is written from the image sensor 1304 for front side image into the line memory 1350. Also, when it has read the image on the back side of the original by the image sensor 1309 for back side image, image data corresponding to one line is written from the image sensor 1309 for back side image into the line memory 1350. At this time, the image processing portion 1349 is preordered a reading mode by the external equipment 1357 through the interface 1352.
The CPU 1351 designates and writes a writing-in start position X1 shown in FIG. 14 of the accompanying drawings into the image memory 1355 while effecting image processing conforming to the above-mentioned pre-ordered reading mode on the image data corresponding to one line written into the line memory 1350, by the image processing portion 1349 disposed between the line memory 1350 and the image memory 1355.
The image data corresponding to one line is sent form the line memory 1350 a predetermined number of times (n times) at a predetermined pitch by the original being conveyed, whereby as shown in FIG. 14 of the accompanying drawing, the image data is written into the image memory while sequentially changing its writing-in start position (X2, X3, X4, . . . Xn) into the image memory 1355 by the CPU 1351. At the same time, the image data stored in the image memory 1355 is sent to the external equipment 1357 through the sending portion 1353. The image memory 1355 has a storing capacity sufficient to store therein images obtained by the scanning of the original.
On the other hand, in an image reading apparatus for reading an original image with an original being conveyed, there has been proposed a technique designed to effect warning or change a reading operation when the size of the original read is larger than the size of an image memory storing image information therein (see, for example, Japanese Patent Application Laid-Open No. 2000-295394).
In the scanner described above, it is usually supposed to read out image data from the image memory 1355 in one kind of image mode for a sheet of original and therefore, as shown in FIGS. 13 and 14, image processing suited for a desired mode is effected by the image processing portion 1349 when the image data is stored into the image memory 1355.
On the other hand, there is a use in which image data is read out from the image memory 1355 in a plurality of modes such as a color image mode and a black-and-white image mode for a sheet of original. For example, the color image mode is a mode for preserving the image data for image perusal, and the black-and-white image mode is a mode for effecting optical character recognition (OCR). At this time, in the color image mode, the amount of image data becomes great because of the use for image perusal and the resolution need not be high resolution which requires a preservation space, whereas in the black-and-white image mode, there is resolution necessary for effecting OCR analysis.
However, in the scanner which reads the original image while conveying the original as described above (a scanner of a sheet feeding type), only the image data stored in the image memory 1355 can be outputted. To output image data from the image memory 1355 in another image mode, re-scanning must be effected. That is, the image data once stored in the image memory 1355 cannot be read out with the image mode changed, and to read out the image data from the image memory 1355 by a plurality of different image modes for a sheet of original, the image data had to be again stored from the image sensor 1304 into the image memory 1355.
Specifically, to obtain a plurality of different image data from a sheet of original, it has been necessary to repeat the operation of storing the image data of one and the same original into the image memory 1355 while carrying out image processing conforming to a desired image mode by the image processing portion 1349.
That is, in the scanner of the sheet feeding type, to repeat the operation of storing the image data of one and the same original into the image memory 1355 in a plurality of image modes, it is necessary to provide such a mechanism or the like as can feed the original discharged from the scanner again to the scanner, and this has led to the problem of a great increase in cost.
So, in a case where it is necessary to read out image data in a plurality of image modes, for example, in the above-described use which requires a plurality of image modes such as the color image mode and the black-and-white image mode, the scanner has performed a scanning operation at a resolution necessary for effecting the OCR analysis and in the color image mode, has stored image data obtained by the scanning operation into the image memory 1355, has transmitted the stored image data to the external equipment 1357 such as, for example, a PC, and has effected resolution conversion for the color image in the external equipment, and has effected mode conversion from the color to the black-and-white for the black-and-white image.
Generally, however, the resolution conversion and the mode conversion can be done more quickly by hardware in the scanner than by software and therefore, when the resolution conversion and the mode change are effected by software in the external equipment, and particularly when image data becomes great like color image data or the like, not only very much time is required for the converting process, but also very much time is required for the forwarding of the image data from the scanner to the external equipment 1357. This also holds true of image rotation which will be described later.
Also, it is often the case that color image data is generally JPEG (joint photographic experts group)-compressed and handled and therefore, it is possible to adopt a technique of JPEG-compressing the color image data in the scanner, and then forwarding the color image data to the external equipment 1357 to thereby make the size of the image data small, but JPEG is non-reversible compression and therefore, when the JPEG-compressed color image data is decompressed to be OCR-analyzed, the image data is deteriorated from the former image before compressed. This has led to the problem that OCR accuracy drops.
Further, to produce color image data for preservation, compressed high resolution color image data must be decompressed, resolution conversion must be effected and JPEG compression must be effected again, and this had led to the problem that not only the color image data for preservation is further deteriorated in image, but also very much time is required for processing.
Therein, by adding hardware such as an image processing board to the external equipment 1357, a reduction in processing by software can be improved, but the cost becomes a factor.
Also, to analyze the contents of a scanned image in the external equipment, and realize (1) the function of not preserving image data (particularly the function used to automatically discriminate on which of one side two sides of an original the image is present (hereinafter referred to as the white sheet skip) if the image data is a blank sheet (a state in which image data is absent), (2) the function of detecting the size of the original image (hereinafter referred to as the original image size detection), (3) the function of effecting image erection with respect to the conveying direction of the original (hereinafter referred to as the orientation detection), etc., it is impossible to read out the image data with the mode of the image data once stored in the image memory 1355 changed and therefore, processing must be carried out from image data subjected to image processing suited for a desired mode. For example, the following problems arise.
(1) When the white sheet skip is to be done, to judge and analyze whether the image data is a blank sheet, the image data maybe black-and-white image data of very low resolution, but in the case of color image data, very much time is required for the forwarding and analysis of the color image data, and moreover in the case of a blank sheet, the image data thereof is sometimes not required. In spite of the fact that it is better for the time until whether the image data is a white sheet is judged to be short, particularly when the image data is a blank sheet, the forwarding and analysis time of the image data have become useless.
(2) When the original image size detection is to be effected, to judge and analyze the size of image data read from the original, the image data may be black-and-white image data of very low resolution, but in the case of color image data, very much time has been required for the forwarding and analysis of the color image data, and in a case where the color image data has been JPEG-compressed, very much time has been required for the decompression and analysis of the compressed image data and the recompression of the image data, and the image has been further deteriorated by the decompression and recompression of non-reversible compressed data.
(3) When the orientation detection is to be effected, to judge and analyze the erecting orientation of image data, the image data may be black-and-white image data, but in the case of color image data, very much time has been required for the forwarding and analysis and rotation of the color image data, and in a case where the color image data has been JPEG-compressed, very much time has been required for the decompression, analysis and rotation of the compressed image data and the recompression of the rotated image, and the image has been further deteriorated by the decompression and recompression of irreversible compressed data.
At this time, image rotation, as described above, can be effected more quickly by the hardware in the scanner than by the software and therefore, when the image rotation is effected by the software in the external equipment, and particularly when the image data becomes great like the color image data or the like, very much time is required for the rotating process. However, when the orientation detection is effected by the software in the external equipment, the angle of rotation of the image can be detected at that point of time, but the image data once stored in the image memory 1355 cannot be read out with the mode of the image data changed and therefore, desired rotated image data cannot be forwarded again from the scanner to the external equipment 1357, and even if a rotating mechanism was provided on the hardware in the scanner, it could not be utilized.